package com.lightkits.wms.controller;

import com.lightkits.wms.domain.purchasereceive.PoHistoryExecutor;
import com.lightkits.wms.domain.purchasereceive.PoLineListExecutor;
import com.lightkits.wms.domain.purchasereceive.PurListExecutor;
import com.lightkits.wms.domain.purchasereceive.PurcharseHeadExecutor;
import com.lightkits.wms.domain.purchasereceive.ReceivePoExecutor;
import com.lightkits.wms.domain.purchasereceive.SimPurchaseExecutor;
import com.lightkits.wms.dto.purchasereceive.GetPoHistoryRequestType;
import com.lightkits.wms.dto.purchasereceive.GetPoHistoryResponseType;
import com.lightkits.wms.dto.purchasereceive.GetPoLineListRequestType;
import com.lightkits.wms.dto.purchasereceive.GetPoLineListResponseType;
import com.lightkits.wms.dto.purchasereceive.GetPurHeadRequestType;
import com.lightkits.wms.dto.purchasereceive.GetPurHeadResponseType;
import com.lightkits.wms.dto.purchasereceive.GetPurListRequestType;
import com.lightkits.wms.dto.purchasereceive.GetPurListResponseType;
import com.lightkits.wms.dto.purchasereceive.GetPurchaseSimRequestType;
import com.lightkits.wms.dto.purchasereceive.GetPurchaseSimResponseType;
import com.lightkits.wms.dto.purchasereceive.ReceivePoRequestType;
import com.lightkits.wms.dto.purchasereceive.ReceivePoResponseType;
import io.choerodon.swagger.annotation.Permission;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * PurchaseReceiveService
 *
 * @author jing.wei@hand-china.com
 * Created on 2019/4/25 16:15
 */
/*@SuppressWarnings("all")*/
/*@LightKitsContract(serviceName = "PurchaseReceiveService", serviceNamespace = "center.soa.os-wms.com")*/
@RestController
@RequestMapping("/PurchaseReceiveService")
public class PurchaseReceiveController {
    @PostMapping(value = "/getSimPurchase")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/getSimPurchase")
    @ResponseBody
    public GetPurchaseSimResponseType getSimPurchase(@RequestBody(required = false) GetPurchaseSimRequestType request) {
        return simPurchaseExecutor.service(request);
    }

    @Autowired
    private SimPurchaseExecutor simPurchaseExecutor;

    @PostMapping(value = "/getPurHead")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/getPurHead")
    @ResponseBody
    public GetPurHeadResponseType getPurHead(@RequestBody(required = false) GetPurHeadRequestType request) {
        return purcharseHeadExecutor.service(request);
    }

    @Autowired
    private PurcharseHeadExecutor purcharseHeadExecutor;

    @PostMapping(value = "/getPurList")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/getPurList")
    @ResponseBody
    public GetPurListResponseType getPurList(@RequestBody(required = false) GetPurListRequestType request) {
        return purListExecutor.service(request);
    }

    @Autowired
    private PurListExecutor purListExecutor;

    @PostMapping(value = "/getPoLineList")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/getPoLineList")
    @ResponseBody
    public GetPoLineListResponseType getPoLineList(@RequestBody(required = false) GetPoLineListRequestType request) {
        return poLineListExecutor.service(request);
    }

    @Autowired
    private PoLineListExecutor poLineListExecutor;

    @PostMapping(value = "/getPoCompleted")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/getPoCompleted")
    @ResponseBody
    public GetPoHistoryResponseType getPoCompleted(@RequestBody(required = false) GetPoHistoryRequestType request) {
        return poHistoryExecutor.service(request);
    }

    @Autowired
    private PoHistoryExecutor poHistoryExecutor;

    @PostMapping(value = "/receivePo")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/receivePo")
    @ResponseBody
    public ReceivePoResponseType receivePo(@RequestBody(required = false) ReceivePoRequestType request) {
        return receivePoExecutor.service(request);
    }

    @Autowired
    private ReceivePoExecutor receivePoExecutor;
}
